package com.haha.http.rpc.example.client.controller;

import com.haha.http.rpc.example.api.pojo.Student;
import com.haha.http.rpc.example.api.service.StudentService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhangxiaofan07
 * @version 1.0 2022/2/11
 */
@RestController
public class TestController {
    @Autowired
    private StudentService studentService;

    @RequestMapping("/test")
    public String test() {
        Student student = studentService.getStudent("zhangxiaofan08", 18);
        System.out.println(student);
        System.out.println("====================");

        List<Student> studentList = studentService.getStudentList();
        studentList.forEach(System.out::println);
        return "success\n";
    }
}
